package com.haojiang.mh.remote.utils

import com.haojiang.mh.remote.bean.BleRssiDevice
import com.haojiang.mh.remote.bean.GattBean
import com.haojiang.mh.remote.bean.UuidValue
import com.haojiang.mh.remote.enums.EVendor
import com.haojiang.mh.remote.utils.Constant.UUID_CHARACTERISTIC_READ_N1
import com.haojiang.mh.remote.utils.Constant.UUID_CHARACTERISTIC_READ_W1
import com.haojiang.mh.remote.utils.Constant.UUID_CHARACTERISTIC_READ_W2
import com.haojiang.mh.remote.utils.Constant.UUID_CHARACTERISTIC_READ_W3
import com.haojiang.mh.remote.utils.Constant.UUID_CHARACTERISTIC_READ_W4
import com.haojiang.mh.remote.utils.Constant.UUID_CHARACTERISTIC_WRITE_N1
import com.haojiang.mh.remote.utils.Constant.UUID_CHARACTERISTIC_WRITE_W1
import com.haojiang.mh.remote.utils.Constant.UUID_CHARACTERISTIC_WRITE_W2
import com.haojiang.mh.remote.utils.Constant.UUID_CHARACTERISTIC_WRITE_W3
import com.haojiang.mh.remote.utils.Constant.UUID_CHARACTERISTIC_WRITE_W4
import com.haojiang.mh.remote.utils.Constant.UUID_SERVICE_N1
import com.haojiang.mh.remote.utils.Constant.UUID_SERVICE_W1
import com.haojiang.mh.remote.utils.Constant.UUID_SERVICE_W2
import com.haojiang.mh.remote.utils.Constant.UUID_SERVICE_W3
import com.haojiang.mh.remote.utils.Constant.UUID_SERVICE_W4
import java.util.*

object UuidUtil {

//    val UUID_SERVICE = 0x01
//    val UUID_CHARACTERISTIC_WRITE = 0x02
//    val UUID_CHARACTERISTIC_READ = 0x03

//    val curUuidMap: MutableMap<Int, UUID> = mutableMapOf()
    val curUuidMap: MutableMap<BleRssiDevice, GattBean> = mutableMapOf()

    val uuidMap = mapOf<UUID, UuidValue>(

        //Nordic1的蓝牙数据服务
        UUID.fromString(UUID_SERVICE_N1) to UuidValue(
            EVendor.NORDIC.key,
            UUID.fromString(UUID_CHARACTERISTIC_WRITE_N1),
            UUID.fromString(UUID_CHARACTERISTIC_READ_N1)
        ),

        //维霖通1的蓝牙数据服务
        UUID.fromString(UUID_SERVICE_W1) to UuidValue(
            EVendor.WLT.key,
            UUID.fromString(UUID_CHARACTERISTIC_WRITE_W1),
            UUID.fromString(UUID_CHARACTERISTIC_READ_W1)
        ),

        //维霖通2的蓝牙数据服务
        UUID.fromString(UUID_SERVICE_W2) to UuidValue(
            EVendor.WLT.key,
            UUID.fromString(UUID_CHARACTERISTIC_WRITE_W2),
            UUID.fromString(UUID_CHARACTERISTIC_READ_W2)
        ),

        //维霖通3的蓝牙数据服务
        UUID.fromString(UUID_SERVICE_W3) to UuidValue(
            EVendor.WLT.key,
            UUID.fromString(UUID_CHARACTERISTIC_WRITE_W3),
            UUID.fromString(UUID_CHARACTERISTIC_READ_W3)
        ),


        //维霖通4的蓝牙数据服务
        UUID.fromString(UUID_SERVICE_W4) to UuidValue(
            EVendor.WLT.key,
            UUID.fromString(UUID_CHARACTERISTIC_WRITE_W4),
            UUID.fromString(UUID_CHARACTERISTIC_READ_W4)
        )
    )
}